import org.aswing.plaf.custom.css.AbstractParser;
import org.aswing.plaf.custom.css.ApplicationParser;
import org.aswing.plaf.custom.css.ComponentParser;
import TextField.StyleSheet;
import org.aswing.plaf.custom.css.Components;
import org.aswing.plaf.custom.css.TypedProperties;
import org.aswing.plaf.ASFontUIResource;
import org.aswing.plaf.custom.css.DefaultValues;

class org.aswing.plaf.custom.css.Parser extends AbstractParser
{
	/**
	* Parse an StyleSheet and returns the UIDefaults of the given style
	* 
	* @param	css An style sheet
	* @return	The UIDefaults of the given style
	*/
	public static function parse(css:StyleSheet):Array{
		var result:Array = [];
		var blocks:Array = css.getStyleNames();	
		
		//all components
		if(css.getStyle("application") != null)
			result = concat(result,ApplicationParser.parse(css.getStyle("application")))
				
		//Components:Controls,...
        for (var i=0; i < Components.LEAF.length; i++) {
            var block:Object = css.getStyle(Components.LEAF[i])
			if (block != null)
				result = concat(result, ComponentParser.parse(Components.LEAF[i],block))
        }
		
		return result;
	}
	
	
	
}